package 找单独的数.src.main;

//异或运算
public class Main {
    public static int solution(int[] inp) {

        int singleNumber = 0;
        for (int number : inp) {
            singleNumber ^= number;
        }
        return singleNumber;
    }




    public static void main(String[] args) {
        // Add your test cases here
        System.out.println(solution(new int[]{1, 1, 2, 2, 3, 3, 4, 5, 5}) == 4);
        System.out.println(solution(new int[]{0, 1, 0, 1, 2}) == 2);
    }
}
